<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
<button id="btn1">单机</button>
<button id="btn2">双击</button>
<button id="btn3">鼠标按下</button>
<button id="btn4">鼠标抬起</button>
<script>

    // var btn1 = document.getElementById("btn1");
    var btn2 = document.getElementById("btn2");
    var btn3 = document.getElementById("btn3");
    var btn4 = document.getElementById("btn4");

    btn1.onclick = function () {
        console.log("单机");
    }
    btn2.ondblclick = function () {
        console.log("双击");
    }
    btn3.onmousedown = function () {
        console.log("鼠标按下");
    }
    btn4.onmouseup = function () {
        console.log("鼠标抬起");

    }
</script>


</body>

</html>